package com.app.mapper;

import com.app.model.AnswerModel;
import com.app.model.OptionModel;
import com.app.model.QuestionModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface QuestionnaireMapper extends BaseMapper<AnswerModel> {
    List<OptionModel> getAll();

    List<OptionModel> getOptionById(int id);

    List<QuestionModel> getQuestionName();


    List<AnswerModel> selectAnswer();

    List<AnswerModel> selectAnswerContent(Integer userId);

    QuestionModel selectQuestion(Integer questionId);

    String selectOption(Integer integer);

    List<QuestionModel> selectQuestionName(String name);

    List<OptionModel> selectOptionById(int id);
    @Update("update lm_option set status=#{status} where id=#{id}")
    void updateStatus(Integer status, Integer id);

    List<AnswerModel> selectCreateTime();

    int getCount();
}

